package me.uni.skyme.support;

import java.util.Map;

import org.springframework.web.servlet.view.json.MappingJackson2JsonView;

public class MappingJsonView extends MappingJackson2JsonView {

	@Override
	protected Object filterModel(Map<String, Object> map) {
		Map<?, ?> result = (Map<?, ?>) super.filterModel(map);
		if (result!=null&&result.size() == 1) {
			return result.values().iterator().next();
		} else {
			return result;
		}
	}

}
